#define _CRT_SECURE_NO_WARNINGS 1
#include"list.h"
void test1()
{
	listnode* phead=NULL;
	phead = init_listnode(phead);
	list_pushback(phead,1);
	list_pushback(phead, 2);
	list_pushback(phead,3);
	list_pushfront(phead, 10086);
	list_pushfront(phead, 520);
	print_list(phead);
	list_popfront(phead);
	print_list(phead);
	list_popfront(phead);
	print_list(phead);
	list_popfront(phead);
	print_list(phead);
	list_popfront(phead);
	print_list(phead);
	list_popfront(phead);
	print_list(phead);
	list_popback(phead);
}
void test2()
{
	listnode* phead = NULL;
	phead = init_listnode(phead);
	list_pushback(phead, 1);
	list_pushback(phead, 2);
	list_pushback(phead, 3);
	//listnode*pos=list_find(phead,1);
	list_insert_before(phead,10086);
	print_list(phead);
}
void test3()
{
	listnode* phead = NULL;
	phead = init_listnode(phead);
	//list_erase(phead->next);
	list_pushback(phead, 1);
	list_pushback(phead, 2);
	list_pushback(phead, 3);
	/*list_pushback(phead, 4);
	list_pushback(phead, 5);
	list_pushback(phead, 6);*/
	listnode*pos=list_find(phead,2);
	list_erase(pos);//2
	print_list(phead);
	list_erase(phead->next);//1
	print_list(phead);
	list_erase(phead->prev);//6
	print_list(phead);
	list_pushback(phead, 1);
	list_pushback(phead, 2);
	list_pushback(phead, 3);
	print_list(phead);
}
void test4()
{
	listnode* phead = NULL;
	phead = init_listnode(phead);
	list_pushfront(phead, 1);
	print_list(phead);
	list_pushfront(phead, 2);
	list_pushfront(phead, 3);
	print_list(phead);
	list_destory(phead);
	phead = init_listnode(phead);
	list_pushfront(phead, 2);
	list_pushfront(phead, 3);
	print_list(phead);
}
void test5()
{
	listnode* phead = NULL;
	phead = init_listnode(phead);
	list_pushback(phead, 1);
	list_pushback(phead, 2);
	list_pushback(phead, 3);
	list_erase(phead);

	//list_erase(phead->prev);
	//list_erase(phead->prev);
	//list_erase(phead->prev);
	//list_erase(phead);

}
int main()
{
	test5();
}